//
//  OrderUserinfoTableViewCell.m
//  智积分
//
//  Created by apple on 2018/5/15.
//  Copyright © 2018年 Cynic. All rights reserved.
//

#import "OrderUserinfoTableViewCell.h"

@implementation OrderUserinfoTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

/*
 @property (nonatomic ,retain)UILabel *status;
 @property (nonatomic ,retain)UILabel *name;
 @property (nonatomic ,retain)UILabel *phone;
 @property (nonatomic ,retain)UILabel *place;
 */
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    for (NSInteger index = 0; index < 2; index ++) {
        UILabel *partlabel = [[UILabel alloc] initWithFrame:CGRectMake(12 + (cx_wid - 24 - 60) * index, 12, 60, 16)];
        partlabel.font = [UIFont systemFontOfSize:14];
        if (index == 1) {
            partlabel.textAlignment = NSTextAlignmentRight;
            _status = partlabel;
            partlabel.textColor = [CXSinglerModel colorWithHex:@"FE4438" alpha:1];
        }
        else{
            partlabel.text = @"订单状态";
            partlabel.textColor = [CXSinglerModel colorWithHex:@"666666" alpha:1];
        }
        [self.contentView addSubview:partlabel];
    }
    UIView *centerdisView = [[UIView alloc] initWithFrame:CGRectMake(0, 40, cx_wid, 10)];
    centerdisView.backgroundColor = [CXSinglerModel colorWithHex:@"f3f4f6" alpha:1];
    [self.contentView addSubview:centerdisView];
    _name = [UILabel CXCreateLabelwithFrame:CGRectMake(33, 60, cx_wid / 2 - 33, 16) withtTitle:@"" inColor:[UIColor clearColor] withHasBottomLayer:NO withbottomlayerHit:0 withBottomLayercolor:[UIColor clearColor] withLabelfont:16 withlabelTextColor:[UIColor blackColor] withReturnLabel:YES beyoundview:self.contentView];
    _phone = [UILabel CXCreateLabelwithFrame:CGRectMake(cx_wid - 27 - 110, 60, 110, 16) withtTitle:@"" inColor:[UIColor clearColor] withHasBottomLayer:NO withbottomlayerHit:0 withBottomLayercolor:[UIColor clearColor] withLabelfont:16 withlabelTextColor:[UIColor blackColor] withReturnLabel:YES beyoundview:self.contentView];
    _place = [UILabel CXCreateLabelwithFrame:CGRectMake(33, 90, cx_wid - 33 - 27, 38) withtTitle:@"" inColor:[UIColor clearColor] withHasBottomLayer:NO withbottomlayerHit:0 withBottomLayercolor:[UIColor clearColor] withLabelfont:15 withlabelTextColor:[CXSinglerModel colorWithHex:@"999999" alpha:1] withReturnLabel:YES beyoundview:self.contentView];
    _place.numberOfLines = 2;
    UIImageView *point = [[UIImageView alloc] initWithFrame:CGRectMake(12, 90, 10, 14)];
    point.image = [UIImage imageNamed:@"adress"];
    [self.contentView addSubview:point];
    
    [self LoadImageWithframe:CGRectMake(cx_wid - 19, 90, 7, 12) withData:@"返回" baseOnView:self.contentView];
    
    UIImageView *lineview = [[UIImageView alloc] initWithFrame:CGRectMake(0, 142, cx_wid, 3)];
    lineview.image = [UIImage imageNamed:@"line_"];
    [self.contentView addSubview:lineview];
    

//    UIButton *transimg = [[UIButton alloc] initWithFrame:CGRectMake(12, 152, 40, 40)];
//    transimg.layer.cornerRadius = 20;
//    transimg.backgroundColor = [UIColor orangeColor];
//    [self.contentView addSubview:transimg];
    
    _transimg = [[UIButton alloc] initWithFrame:CGRectMake(12, 152, 40, 40)];
//    _transimg.layer.cornerRadius = 20;
//    _transimg.backgroundColor = [CXSinglerModel colorWithHex:@"f3f4f6" alpha:1];
    [_transimg setImage:[UIImage imageNamed:@"物流"] forState:UIControlStateNormal];
    _transimg.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    [self.contentView addSubview:_transimg];
    
    _transname = [UILabel CXCreateLabelwithFrame:CGRectMake(62, 164, 85, 16) withtTitle:@"name" inColor:[UIColor clearColor] withHasBottomLayer:NO withbottomlayerHit:0 withBottomLayercolor:[UIColor clearColor] withLabelfont:13 withlabelTextColor:[UIColor blackColor] withReturnLabel:YES beyoundview:self.contentView];
    _transid = [UILabel CXCreateLabelwithFrame:CGRectMake(155, 164, 150, 16) withtTitle:@"id" inColor:[UIColor clearColor] withHasBottomLayer:NO withbottomlayerHit:0 withBottomLayercolor:[UIColor clearColor] withLabelfont:13 withlabelTextColor:[CXSinglerModel colorWithHex:@"9B9B9B" alpha:1] withReturnLabel:YES beyoundview:self.contentView];
    _bottomlayerview = [[UIView alloc] initWithFrame:CGRectZero];
    _bottomlayerview.backgroundColor = [CXSinglerModel colorWithHex:@"f3f4f6" alpha:1];
    [self.contentView addSubview:_bottomlayerview];
    [_bottomlayerview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(cx_wid, 10));
        make.bottom.mas_equalTo(0);
    }];
    
    return self;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
